package com.chushouya.manager.dto.admin.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.chushouya.common.constant.AdminUserType;
import com.general.framework.core.enums.StatusEnum;
import com.general.framework.core.lang.Dates;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@ApiModel("用户列表DTO")
@Data
public class AdminUserListDTO {

    @ApiModelProperty("用户ID")
    private Long adminUserId;

    @ApiModelProperty("部门Id")
    private Long deptId;

    @ApiModelProperty("部门名称")
    private String deptName;

    @ApiModelProperty("角色名称")
    private String roleName;

    @ApiModelProperty("用户名称")
    private String userName;

    @ApiModelProperty("用户昵称")
    private String nickName;

    @ApiModelProperty("用户类型")
    private Integer userType;

    @ApiModelProperty("用户类型")
    private String userTypeName;

    @ApiModelProperty("手机号")
    private String phoneNumber;

    @ApiModelProperty("是否为超级管理员")
    private boolean superAdmin;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("状态")
    private String statusDesc;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    public String getStatusDesc() {
        return StatusEnum.getDesc(status);
    }

    public String getUserTypeName() {
        return AdminUserType.getDesc(this.userType);
    }
}
